package book;

public class BookList {
    private static final int DEFAULT_SIZE = 10;
    Book[] book = new Book[DEFAULT_SIZE];
    private int usedSize ;

    public BookList() {
        book[0] = new Book("红楼梦","曹雪芹",55,"中国古典文学");
        book[1] = new Book("西游记","吴承恩",68,"浪漫主义章回体长篇神魔小说");
        book[2] = new Book("三国演义","罗贯中",60,"长篇章回体历史演义小说");
        book[3] = new Book("水浒传","施耐庵",70,"章回体长篇小说");

        this.usedSize = 4;
    }

    public Book getBook(int pos){
        return this.book[pos];
    }

    public void setBook(Book book){
      this.book[usedSize] = book;
    }

    public void setBook(int pos , Book book){
        this.book[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

}
